package com.think.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.think.common.convert.Convert;
import com.think.common.enums.IsDeleteEnum;
import com.think.common.enums.StateEnum;
import com.think.common.enums.SysUserTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 管理员用户表
 * </p>
 *
 * @author cwy
 * @since 2019-07-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_user")
public class SysUser extends Convert {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId(value = "user_id", type = IdType.UUID)
    private String userId;

    /**
     * 账号
     */
    private String username;

    /**
     * 密码
     */
    private String pwd;

    /**
     * 昵称
     */
    private String name;

    /**
     * 状态：0.启用，1.禁用
     */
    @TableField(fill = FieldFill.INSERT)
    private StateEnum state;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    /**
     * 账号类型 ：1.老板 2.财务 3.销售经理 4.渠道经理 5.销售
     */
    private SysUserTypeEnum type;

    /**
     * 公司关联id
     */
    private String companyId;

    /**
     * 是否删除：0.正常，1.删除
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private IsDeleteEnum isDelete;

    /**
     * 工资金额
     */
    private BigDecimal wage;

    /**
     * FastDFS图片文件夹目录名
     */
    private String groupName;

    /**
     * 图片地址
     */
    private String photoLink;

    /**
     * 删除时间
     */
    private LocalDateTime gmtDelete;

    /**
     * 创建人ID
     */
    private String createUser;


    public static final String USER_ID = "user_id";

    public static final String USERNAME = "username";

    public static final String PWD = "pwd";

    public static final String NAME = "name";

    public static final String STATE = "state";

    public static final String REMARK = "remark";

    public static final String GMT_CREATE = "gmt_create";

    public static final String GMT_MODIFIED = "gmt_modified";

    public static final String TYPE = "type";

    public static final String COMPANY_ID = "company_id";

    public static final String IS_DELETE = "is_delete";

    public static final String GMT_DELETE = "gmt_delete";

    public static final String CREATE_USER = "create_user";

}
